package com.craftplay.dao;

import com.craftplay.model.Focus;
import com.craftplay.model.GlobalAreaModel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

@Mapper
public interface GlobalAreaMapper {

    @Select({
            "select * from  global_area ",
            "where ga_parentcode = #{gaParentCode,jdbcType=INTEGER} order by ga_sort"
    })
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true),
            @Result(column = "ga_name", property = "gaName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "ga_code", property = "gaCode", jdbcType = JdbcType.VARCHAR),
            @Result(column = "ga_parentcode", property = "gaParentCode", jdbcType = JdbcType.VARCHAR),
    })
    List<GlobalAreaModel> selectByParentCode(String gaParentCode);
}
